const Base = require("../base.js");
/*
接口调式
RequestType = 请求类型
url = 接口地址
data = 参数
headers = 请求头的header
*/
module.exports = class extends Base {
  async indexAction() {
      let RequestType = this.get("RequestType")||0 // 0get 1post
      let csData = this.get("data")
      let csheaders = this.get("headers")
      if(csData){
        csData = JSON.parse(csData)
      }
      if(csheaders){
        csheaders = JSON.parse(csheaders)
      }
      let res = ""
      if(RequestType==0){
         res = await this.dxGet(this.get("url"),csData,csheaders)
      }else{
        res = await this.dxPost(this.get("url"),csData,csheaders)
      }
      this.success(res)
  }
};
